import axios from 'axios';

// let base = 'http://2052c4i556.51mypc.cn/bbs';
let base = 'http://192.168.1.176:8081/bbs';

export const requestLogin = params => { return axios.post(`${base}/login`, params).then(res => res.data); };

export const getSecurity = () => { return axios.get(`${base}/getSecurity`).then(res => res.data)};

export const isusernameexist = params => { return axios.get(`${base}/isusernameexist`,{params:params}).then(res=>res.data);};

export const register = params => { return axios.post(`${base}/register`,params).then(res => res.data)};

export const getcurrenttemp = () => { return axios.get(`${base}/getcurrenttemp`).then(res => res.data)};

export const getcurrentlight = () => { return axios.get(`${base}/getcurrentlight`).then(res => res.data)};

export const getcurrentdian = () => { return axios.get(`${base}/getcurrentdian`).then(res => res.data)};

export const getTempLib = params => { return axios.get(`${base}/getTempLib`,{params:params}).then(res => res.data)};

export const getDianLib = params => { return axios.get(`${base}/getDianLib`,{params:params}).then(res => res.data)};

export const getWaterLib = params => { return axios.get(`${base}/getWaterLib`,{params:params}).then(res => res.data)};

export const getLightLib = params => { return axios.get(`${base}/getLightLib`,{params:params}).then(res => res.data)};

